<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>protals 传送门</title>
</head>

<body>
    <div id="root">

    </div>
    <div id="Mask">

    </div>

    <script src="./react.js"></script>
    <script src="./react-dom.js"></script>
    <script src="./babel.min.js"></script>
    <script type="text/babel">
        function App() {
            return (
                <div>
                    <h1>传送门使用 protals的使用</h1>
                    <div>
                        内容
                    </div>
                </div>
            )
        }
        function Mask() {
            return (
                <div>弹出框</div>
            )
        }
        function Child() {
            // 创建传送门  节点
            return ReactDOM.createPortal(<Mask />, document.getElementById('mask'))
        }
        ReactDOM.render(<App />, document.getElementById('root'))

    </script>


</body>

</html>